﻿@using Kendo.Mvc.UI
@model DXWebApplication.Areas.Administrators.Models.SiteModel 
<div id="msgList" class="msgListMainContainer slideOnResize">
    <script>
        initMessages= {
            Title: {
                required: '@HttpUtility.JavaScriptStringEncode(MessageResource.Required)',
                maxlength: '@HttpUtility.JavaScriptStringEncode(MessageResource.StringLength255)'
            },
            Controller: {
                required: '@HttpUtility.JavaScriptStringEncode(MessageResource.Required)',
                maxlength: '@HttpUtility.JavaScriptStringEncode(MessageResource.StringLength50)'
            }
        }        
    </script>
    @using (Html.BeginForm(null, null, null, FormMethod.Post, new { @id = "commitData" }))
    {                
        @Html.ValidationSummary(true)
        @Html.HiddenFor(x=>x.Id)
        <div class="msgBox">
            <div class="advMiddle frmMain">
                <div class="advLeft">
                    <div class="advLeftWrapper">
                        <table class="advTable">
                            <colgroup>
                                <col class="asLblCol" />
                                <col class="asValCol" />
                            </colgroup>
                            <tr>
                                <td class="advLabel">@AdminResource.lbTitle:</td>
                                <td>
                                    <div class="asVal asWd asWdPr">
                                        @Html.TextBoxFor(x => x.Title,new{@required=true,@maxlength=255})
                                        @Html.ValidationMessageFor(x=>x.Title)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="advLabel">@AdminResource.lbController:</td>
                                <td>
                                    <div class="asVal asWd asWdPr">
                                        @Html.TextBoxFor(x => x.Controller,new{@required=true,@maxlength=50})
                                        @Html.ValidationMessageFor(x=>x.Title)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="advLabel">@AdminResource.lbParent:</td>
                                <td class="advLabel">
                                    <div class="asVal asWd asWdPr">                                        
                                        @(Html.Kendo().ComboBoxFor(x=>x.ParentId)                                          
                                              .Filter(FilterType.Contains)
                                              .Placeholder("Danh mục cha")
                                              .DataTextField("Text")
                                              .DataValueField("Value")
                                              .BindTo(ViewBag.Parents)
                                              .Value(@Model.ParentId.ToString())
                                              .Suggest(true))
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="advRight">
                    <div class="advRightWrapper">
                        <table cellspacing="0" cellpadding="0" class="advTable">
                            <colgroup>
                                <col class="asLblCol" />
                                <col class="asValCol" />
                            </colgroup>
                            <tr>
                                <td class="advLabel">@AdminResource.lbStatus:</td>
                                <td class="advLabel">
                                    <div class="asVal asWd asWdPr">
                                        @(Html.Kendo().ComboBoxFor(x=>x.Status)                                                                                       
                                              .DataTextField("Text")
                                              .DataValueField("Value")
                                              .BindTo(new List<SelectListItem>(){new SelectListItem(){Text = AdminResource.lbActive,Value = "True",Selected = true},new SelectListItem(){Text = AdminResource.lbBlock,Value = "False"}})
                                              .Value(Model.Status.HasValue.ToString())
                                              .Suggest(true))                                        
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="advLabel">@AdminResource.lbDescription:</td>
                                <td>
                                    <div class="asVal asWd asWdPr">
                                        @Html.TextAreaFor(x => x.Description, new { @row = 4 })
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="command">
                    <table>
                        <tr>
                            <td class="AsLbl"></td>
                            <td>
                                <div class="AsVal">
                                    <button class="default" type="submit" id="btnSave">@AdminResource.lbSave</button>
                                    <button id="as_cancel" type="button">@AdminResource.lbCancel</button>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>        
    }
</div>
